const svgCaptcha = require('svg-captcha');

function generateCaptcha() {
    const captcha = svgCaptcha.create({
        size: 4,
        noise: 3,
        color: true,
        background: '#f0f0f0',
        width: 120,
        height: 40,
        fontSize: 40,
        charPreset: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    });
    
    return {
        text: captcha.text,
        data: captcha.data
    };
}

module.exports = {
    generateCaptcha
}; 